package com.smart.service;

import java.sql.SQLException;
import java.util.Date;

import com.smart.dao.IdentifierCodeDAO;

public class IdentifierCodeService {
	  public int insert(String identifier,String code)
	  {
		  int x=0;
		  IdentifierCodeDAO identifierCodeDAO=new IdentifierCodeDAO();
		  try {
		     x=identifierCodeDAO.insert(identifier, code);
		  } catch (SQLException e) {
			e.printStackTrace();
		  }
		  return x;
	  }
	  
	  public String getCode(String identifier)
	  {
		  String code=null;
		  IdentifierCodeDAO identifierCodeDAO=new IdentifierCodeDAO();
		  try {
			code=identifierCodeDAO.getCode(identifier);
		  } catch (SQLException e) {
			e.printStackTrace();
		  }
		  return code;
	   }
	  
	  public void RmOutDate(Date date)
	  {
		  IdentifierCodeDAO identifierCodeDAO=new IdentifierCodeDAO();
		  try {
			identifierCodeDAO.RmOutDate(date);
		  } catch (SQLException e) {
			e.printStackTrace();
		  }
	  }
	  
	  public  static void main(String[] args)
	  {
		  String identifier="nk5230";
		  String code="111";
		  new IdentifierCodeService().insert(identifier, code);
	  }
}
